<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>订单编辑</span>
      </div>
      <el-form :model="form" label-width="120px" class="form">
        <el-form-item prop="orderNo" label="订单号:">
          <el-input v-model="form.orderNo"></el-input>
        </el-form-item>
        <el-form-item prop="orderTime" label="下单时间:">
          <el-date-picker
            v-model="form.orderTime"
            format="HH:mm:ss"
            type="datetime"
            placeholder="选择日期时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item prop="phone" label="联系电话:">
          <el-input v-model="form.phone"></el-input>
        </el-form-item>
        <el-form-item prop="consignee" label="收货人:">
          <el-input v-model="form.consignee"></el-input>
        </el-form-item>
        <el-form-item prop="deliverAddress" label="送货地址:">
          <el-input v-model="form.deliverAddress"></el-input>
        </el-form-item>
        <el-form-item prop="deliveryTime" label="送达时间:">
          <el-date-picker
            v-model="form.deliveryTime"
            format="HH:mm:ss"
            type="datetime"
            placeholder="选择日期时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item prop="remarks" label="备注:">
          <el-input v-model="form.remarks"></el-input>
        </el-form-item>
        <el-form-item prop="orderAmount" label="订单金额:">
          <el-input-number
            v-model="form.orderAmount"
            :min="0"
            :max="100"
          ></el-input-number>
        </el-form-item>
        <el-form-item prop="orderState" label="订单状态">
          <el-select v-model="form.orderState" placeholder="订单状态">
            <el-option label="已完成" value="已完成"></el-option>
            <el-option label="进行中" value="进行中"></el-option>
            <el-option label="派送中" value="派送中"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="">
          <el-button type="primary" @click="upload"
            >上传</el-button
          ></el-form-item
        >
      </el-form>
    </el-card>
  </div>
</template>

<script>
import { orderEdit } from '@/api/order';
export default {
  data () {
    return {
      form: {}
    }
  },
  methods: {
    async upload () {
      let res = await orderEdit({ ...this.form })
      console.log('res :>> ', res);
    }
  },
  created () {
    let { id } = this.$route.query
    this.form = { ...id }
  }
}
</script>

<style lang="less" scoped>
.form {
  width: 500px;
}
</style>
